Printing a file

The primary example’s code is located in the «FastReport Demos\PrintFile» directory. Let us explain several details.

For printing, you should use a report with a «Master Data» band, which will be printed once (to perform this, it should be connected to a data source, which contains one record; select a source named "Single row" from the list). Stretching («Stretch») and splitting («Allow Split») are enabled in the band. This means, that the way the band is stretched allows finding room for all objects located in it. However, if a band does not find room in a page, it will be presented partially in separate pages.

File contents are presented via the «Text» object, which contains the [file] variable. This variable, as in the previous examples, is filled in the «TfrxReport.OnGetValue» event. Stretching is also enabled in the object (the «Stretch» item from the contextual menu or the «StretchMode» property = smActualHeight).